package com.licw.mapper;

import com.github.pagehelper.Page;
import com.licw.annotation.AutoFill;
import com.licw.dto.CategoryPageQueryDTO;
import com.licw.entity.Category;
import com.licw.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface CategoryMapper {

    @AutoFill(OperationType.INSERT)
    void insert(Category category);

    List<Category> list(Integer type);

    @Update("delete from drabbit_take_out.category where id = #{id}")
    void deleteById(Long id);

    @AutoFill(OperationType.UPDATE)
    void update(Category category);

    Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);
}
